package com.technology.education.widget

import android.content.Context
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatButton
import com.technology.education.R
import com.technology.education.ext.getColor
import com.technology.education.ext.getResId
import me.hgj.jetpackmvvm.ext.util.dp2px


/**
 *@author:create by BZY
 *Date: 2022/2/24 12
 */
class CommonButton : AppCompatButton {
    init {
        setTextColor(getColor(R.color.white))
        background = getResId(R.drawable.bg_button)
        height = dp2px(45)
    }

    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {}
    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
    }

//    var currentTime = 0L
//    override fun callOnClick(): Boolean {
//        return if (System.currentTimeMillis() - currentTime > 500) {
//            currentTime=System.currentTimeMillis()
//            super.callOnClick()
//        } else {
//            currentTime=System.currentTimeMillis()
//            false
//        }
//    }

}